<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>会员管理</title>
		<!-- Bootstrap core CSS -->
		<link href="asserts/css/bootstrap.min.css" th:href="@{/asserts/css/bootstrap.min.css}" rel="stylesheet">

		<!-- Custom styles for this template -->
		<link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">

	</head>

	<body>
		<!-- 插入公共部分topbar !-->
		<div th:replace="commons/bar::#topBar"></div>

		<div class="container-fluid">
			<div class="row">
				<!--插入公共部分sidebar-->
				<div th:replace="commons/bar::#sidebar(activeUrl='manage/members')"></div>

				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<h2>会员信息</h2>
					<div class="table-responsive">
						<table class="table table-striped table-bordered">
							<thead>
								<tr align="center">
									<th>用户名</th>
									<th>实 名</th>
									<th>城 市</th>
									<th>电 话</th>
									<th>邮 箱</th>
									<th>金 额</th>
									<th>冻 结</th>
								</tr>
							</thead>
							<tbody>
								<tr th:each="member :${memberPage.content}" align="center">
									<td >
										<a th:text="${member.memberName}"
										   th:href="@{/manage/member/}+${member.memberID}" ></a>
									</td>
									<td th:text="${member.memberTrueName}"> </td>
									<td th:text="${member.memberCity}==''?'-':${member.memberCity}"> </td>
									<td th:text="${member.memberTel}"> </td>
									<td th:text="${member.memberEmail}"> </td>
									<td th:text="${member.memberAmount}"> </td>
									<td th:text="${member.memberFreeze}==1?'解冻':'冻结'">冻结</td>
								</tr>

							</tbody>
						</table>
					</div>

				<!--分页导航栏-->
					<div class="row justify-content-end">
						<div class="col-4">
							<span
									th:text="|当前第 ${memberPage.number+1} 页，
									共 ${memberPage.totalPages} 页，
									总 ${memberPage.totalElements} 条数据|" >
							</span>

						</div>
						<div class="col-4">
							<nav aria-label="Page navigation example">
								<ul class="pagination  " >
									<li class="page-item "
										th:class="${memberPage.number<1}?'page-item disabled':'page-item'" >
										<a class="page-link" href="#"
										   th:href="@{/manage/members/}+${memberPage.number}">上一页</a>
									</li>
									<li class="page-item"
										th:each="pageNum :${#numbers.sequence(1, memberPage.totalPages)}"
										th:class="${pageNum == memberPage.number+1}?'page-item active':'page-item'">
										<a class="page-link" href="#"
										   th:href="@{/manage/members/}+${pageNum}"
										   th:text="${pageNum}">
										</a>
									</li>
									<li class="page-item"
										th:class="${memberPage.number>memberPage.totalPages-2}?'page-item disabled':'page-item'">
										<a class="page-link" href="#"
										   th:href="@{/manage/members/}+${memberPage.number+2}">下一页</a>
									</li>
								</ul>
							</nav>
						</div>
					</div>
				</main>
			</div>
		</div>

		<!-- Bootstrap core JavaScript
    ================================================== -->
		<!-- Placed at the end of the document so the pages load faster -->
		<script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js" th:src="@{/asserts/js/jquery-3.2.1.slim.min.js}" ></script>
		<script type="text/javascript" src="asserts/js/popper.min.js" th:src="@{/asserts/js/popper.min.js}"></script>
		<script type="text/javascript" src="asserts/js/bootstrap.min.js" th:src="@{/asserts/js/bootstrap.min.js}"></script>

		<!-- Icons -->
		<script type="text/javascript" src="asserts/js/feather.min.js" th:src="@{/asserts/js/feather.min.js}"></script>
		<script>
			feather.replace()
		</script>

	</body>

</html>